/**
 * Created by HP on 2016/6/7.
 */
var queryDom = null;
$(function() {
    if ($("#search-key2").length > 0) {
        queryDom = $("#search-key2")
    } else {
        if ($("#search-key").length > 0) {
            queryDom = $("#search-key")
        }
    }
    if (queryDom && queryDom.length > 0) {
        queryDom.keydown(function(a) {
            if (a.which == "13") {
                search()
            }
        });
    }
});
function search() {
    var b = $.trim(queryDom.val());
    if (b != "") {
        var a = "/query/" + b;
        window.location.href = a
    }
}